
//将时间(秒数)格式化为时分秒结构
export function formatSeconds2HMS(timeInSeconds) {
  var hour = parseInt(timeInSeconds / 3600)
  if (hour < 10) hour = '0' + hour
  var minute = parseInt(timeInSeconds % 3600 / 60)
  if (minute < 10) minute = '0' + minute
  var seconds = parseInt(timeInSeconds % 60)
  if (seconds < 10) {
    seconds = '0' + seconds
  }
  return `${hour}:${minute}:${seconds}`
}

//将时间(秒数)格式化为时分秒结构
export function formatMinutes2MSSS(timeOffset) {
  var minute = parseInt(timeOffset / 1000 / 60)
  if (minute < 10) minute = '0' + minute
  var seconds = parseInt((timeOffset / 1000) % 60)
  if (seconds < 10) seconds = '0' + seconds
  var miniSeconds = parseInt(timeOffset % 1000)
  if (miniSeconds < 10) {
    miniSeconds = '00' + miniSeconds
  } else if (miniSeconds < 100) {
    miniSeconds = '0' + miniSeconds
  }
  return `${minute}:${seconds}:${miniSeconds}`
}
